//package com.example.seed.interceptor;
//
//import com.example.seed.entity.SysUser;
//import com.example.seed.entity.SysUserDraft;
//import com.example.seed.entity.SysUserProps;
//import org.babyfish.jimmer.ImmutableObjects;
//import org.babyfish.jimmer.sql.DraftInterceptor;
//import org.jetbrains.annotations.NotNull;
//import org.jetbrains.annotations.Nullable;
//import org.springframework.stereotype.Component;
//
///**
// * User实体拦截器
// *
// * @author AAA
// * @date 2024/02/26
// */
//@Component
//public class SysUserEntityDraftInterceptor implements DraftInterceptor<SysUser, SysUserDraft> {
//
//    @Override
//    public void beforeSave(@NotNull SysUserDraft draft, @Nullable SysUser sysUser) {
//        if (sysUser == null) {
//            if (ImmutableObjects.isLoaded(draft, SysUserProps.ACCOUNT)) {
//                String account = draft.account();
//                draft.setAccount(account);
//            }
//        }
//    }
//}
